﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WpfApp1.Models;

namespace WpfApp1.Servcies
{
    public class UserService
    {
        public static List<User> List()
        {
            var list = new List<User>();
            list.Add(new User(1, "user1", 1, true));
            list.Add(new User(2, "user2", 1, false));
            list.Add(new User(3, "user3", 3, true));
            list.Add(new User(4, "user4", 4, true));
            list.Add(new User(5, "user5", 5, false));
            list.Add(new User(6, "user6", 6, true));
            list.Add(new User(7, "user7", 7, false));
            list.Add(new User(8, "user8", 8, false));
            list.Add(new User(9, "user9", 9, true));
            return list;
        }

        public static List<User> ListByDeptId(int deptId)
        {
            return List().FindAll(m => m.DeptId == deptId);
        }
    }
}
